<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>angular</title>
</head>
<body>
<div ng-app="app" ng-controller="testController">
    {{myUrl}}

</div>

</body>
<script src="../lib/angular-1.5.0/angular.js"></script>
<script>

    const app = angular.module('app',[]);

    // app.controller('testController',function ($scope,$location) {
    //
    //     $scope.myUrl = $location.absUrl();
    //
    // })


    app.service('service1',function () {
        this.square=function (x) {
            return x*x;
        }
    })


    app.controller('testController',function ($scope,service1) {

        $scope.myUrl = service1.square(16);

    })

</script>

</html>